package com.yilin.tms.core.remote;

import com.yilin.tms.core.application.ReturnData;
import com.yilin.tms.core.commons.annotation.NoLoginSecurity;
import com.yilin.tms.core.commons.annotation.SkipLoginVerify;
import com.yilin.tms.core.components.interceptor.ReqProviderInterceptor;
import com.yilin.tms.core.entity.gps.gaode.GeoCalResult;
import com.yilin.tms.core.entity.gps.hyb.EquipmentInfo;
import com.yilin.tms.core.entity.gps.hyb.FenceResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 远程调用 资料服务
 *
 * @author zhangjinyuan
 * @date 2022/10/30
 */
@FeignClient(name = "gps-service-provider", configuration = ReqProviderInterceptor.class)
public interface IGpsRemote {
    /**
     * 初始化高德猎鹰轨迹终端
     * 自动创建终端
     */
    @PostMapping(value = "/gps/track/autoCreateTrackTerminal")
    ReturnData<Map<String, String>> autoCreateTrackTerminal(@RequestParam(value = "platId") String platId,
                                                            @RequestParam(value = "accountId") String accountId);

    /**
     * 创建轨迹
     */
    @PostMapping(value = "/gps/track/createTraceId")
    ReturnData<String> createTraceId(@RequestParam(value = "platId") String platId,
                                     @RequestParam(value = "geoServiceId") String geoServiceId,
                                     @RequestParam(value = "geoTerminalId") String geoTerminalId,
                                     @RequestParam(value = "transportNo") String transportNo
    );


    //------------------------------------------------------------------------------------------------------------------

    /**
     * 逆地理编码
     */
    @PostMapping(value = "/gps/gaode/getAddressByPoint")
    ReturnData<String> getAddressByPoint(@RequestParam(value = "platId") String platId, @RequestParam(value = "point") String point);

    /**
     * 高德规划算路
     */
    @PostMapping(value = "/gps/gaode/getDrivingCalculation")
    @NoLoginSecurity
    ReturnData<GeoCalResult> getDrivingCalculation(@RequestParam(value = "platId") String platId,
                                                   @RequestParam(value = "startCoordinates") String startCoordinates,
                                                   @RequestParam(value = "endCoordinates") String endCoordinates);

    /**
     * 逆地理编码
     * 返回  adcode，address
     */
    @PostMapping(value = "/gps/gaode/getAddressInfoByPoint")
    ReturnData<Map<String, Object>> getAddressInfoByPoint(@RequestParam(value = "platId") String platId,
                                                          @RequestParam(value = "point") String point);

    /**
     * 地理编码 获取地区码
     */
    @PostMapping(value = "/gps/gaode/getAdCodeByAddress")
    ReturnData<String> getAdCodeByAddress(@RequestParam("platId") String platId, @RequestParam("address") String address);


    //-----------------------------------------好运宝------------------------------------------------------

    @PostMapping(value = "/gps/hyb/bindVehicleDevice")
    ReturnData<Object> bindVehicleDevice(@RequestParam("platId")String platId,@RequestParam("deviceId") String deviceId,@RequestParam("vehicleNumber") String vehicleNumber);

    @PostMapping(value = "/gps/hyb/unBindVehicleDevice")
    ReturnData<Object> unBindVehicleDevice(@RequestParam("platId")String platId,@RequestParam("deviceId") String deviceId,@RequestParam("vehicleNumber") String vehicleNumber);


    @PostMapping(value = "/gps/hyb/storeDevicePolygon")
    ReturnData<FenceResult> storeDevicePolygon(@RequestParam("platId")String platId,@RequestParam("transportNo") String transportNo, @RequestParam("vehicleNumber")String vehicleNumber,
                                               @RequestParam("driverName")String driverName,@RequestParam("fenceInfoListJson") String fenceInfoListJson);


    @PostMapping(value = "/gps/hyb/deleteStoreDevicePolygon")
    ReturnData<Object> deleteStoreDevicePolygon(@RequestParam("platId")String platId,@RequestParam("transportNo") String transportNo);


    @PostMapping(value = "/gps/hyb/getTrackDeviceInfos")
    ReturnData<List<EquipmentInfo>> getTrackDeviceInfos(@RequestParam("platId")String platId, @RequestParam("deviceIds") String deviceIds);


    @PostMapping(value = "/gps/hyb/getTrackDeviceInfo")
    ReturnData<EquipmentInfo> getTrackDeviceInfo(@RequestParam("platId")String platId, @RequestParam("deviceId") String deviceId);




}
